package 排序算法;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class Demo {

    public static void main(String[] args) {
        AscendingSort ascendingSort = new AscendingSort();
//        int[] arr = new int[]{5,2,3,1};
        int[] arr = new int[]{5,1,9,3,7,4,8,6,6};
//        int[] arr = new int[]{5,1,1,2,0,0};
//        ascendingSort.insertionSort(arr);
//        ascendingSort.shellSort(arr);

        ascendingSort.quickSort(arr);
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i] + " ");
        }
    }


//    public static void main(String[] args) {
//        ThreadPoolExecutor poolExecutor = new ThreadPoolExecutor(3,5,30, TimeUnit.MILLISECONDS,
//                new ArrayBlockingQueue<>(3),new  ThreadPoolExecutor.AbortPolicy());
//        for (int i = 0; i < 100; i++) {
//            int id = i;
//            poolExecutor.execute(() ->{
//                Thread current = Thread.currentThread();
//                //变量捕获  如下代码会报错
////                System.out.println("i = " + i +"  " + current.getName());
//                System.out.println("i = " + id +"  " + current.getName());
//            });
//        }
//    }
}
